package com.alibaba.csp.sentinel.dashboard.rule.nacos;

import com.alibaba.csp.sentinel.dashboard.config.NacosRuleConstants;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity;
import com.alibaba.nacos.api.config.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("degradeRuleNacosProvider")
public class DegradeRuleNacosProvider extends NacosDynamicRuleProvider<DegradeRuleEntity> {
    @Autowired
    public DegradeRuleNacosProvider(ConfigService configService) {
        super(configService);
    }

    @Override
    protected String getDataIdPostfix() {
        return NacosRuleConstants.DEGRADE_DATA_ID_POSTFIX;
    }

    @Override
    protected Class<DegradeRuleEntity> getRuleClass() {
        return DegradeRuleEntity.class;
    }
}
